package com.DefectTracking;
import java.util.*;

public class Defect {

	private String DefectID;
	private String Summary;
	private String Details;
	private String DetectedBy;
	private String DetectedOn;
	private String StatusID;
	private String ProjectID;
	private String ClosedDate;
	private String AssignedTo;
	private List<String> DefectList;

	public Defect () {}


	public Defect (String defectID, String summary, String details, String detectedBy,
			String detectedOn, String statusID, String projectID, String closedDate, String assignedTo) {

		DefectID = defectID;
		Summary = summary;
		Details = details;
		DetectedBy = detectedBy;
		DetectedOn = detectedOn;
		StatusID = statusID;
		ProjectID = projectID;
		ClosedDate = closedDate;
		AssignedTo = assignedTo;

		DefectList = new ArrayList<String>();
		DefectList.add(defectID);
		DefectList.add(summary);
		DefectList.add(details);
		DefectList.add(detectedBy);
		DefectList.add(detectedOn);
		DefectList.add(statusID);
		DefectList.add(projectID);
		DefectList.add(closedDate);
		DefectList.add(assignedTo);
	}
	public Defect (String defectID, String summary, String details, String detectedBy,
			String detectedOn, String statusID, String projectID, String closedDate) {
				this(defectID, summary, details, detectedBy, detectedOn, statusID, projectID, closedDate, new String(""));
			}

	public void setDefectID(String defectId) {
		DefectID = defectId;
	}
	public void setAssignedTo(String assignTo) {
		AssignedTo = assignTo;
	}
	public void setSummary(String summary) {
		Summary = summary;
	}
	public void getDetails(String details) {
		Details = details;
	}
	public void setDetectedBy(String detectedBy) {
		DetectedBy = detectedBy;
	}
	public void setDetectedOn(String detectedOn) {
		DetectedOn = detectedOn;
	}
	public void setStatusID(String statusId) {
		StatusID = statusId;
	}
	public void setProjectID(String projectId) {
		ProjectID = projectId;
	}
	public void setClosedDate(String closedDate) {
		ClosedDate = closedDate;
	}
//getters
	public String getDefectID() {
		return DefectID;
	}
	public String getSummary() {
		return Summary;
	}
	public String getDetails() {
		return Details;
	}
	public String getDetectedBy() {
		return DetectedBy;
	}
	public String getDetectedOn() {
		return DetectedOn;
	}
	public String getStatusID() {
		return StatusID;
	}
	public String getProjectID() {
		return ProjectID;
	}
	public String getClosedDate() {
		return ClosedDate;
	}
	public String getAssignedTo() {
		return AssignedTo;
	}
	public String printDefect() {
		return printDefect(false);
	}

	public String printDefect(boolean silent) {

		String defectString = new String("#: " + getDefectID()+ ","+getSummary()+","+getDetails()+","+getDetectedBy()+","+
							getDetectedOn()+","+getStatusID()+","+getProjectID()+","+getClosedDate());
		if(silent == true) {
			System.out.println(defectString);
		}
		return defectString;
	}
	public List<String> getList() {
		return DefectList;
	}

}